package srzy.data

case class Case(path: String, caseName: String) {
  def getCasePath = path + "/" + caseName.toString
  def getSqlPath = path + "/prepare_" + caseName.toString
  def getMsgPath = path + "/" + caseName + "/" + caseName.toString + ".txt"
  override def toString = getCasePath
}

object Case {
  def casePath(s: String) = {
    val r1 = """([\w/]+)/([\w]+)""".r
    val r1(a, b) = s
    new Case(a, b)
  }
  def sqlPath(s: String) = {
    val r1 = """([\w/]+)/prepare_([\w]+)""".r
    val r1(a, b) = s
    new Case(a, b)
  }
  def msgPath(s: String) = {
    val r1 = """([\w/]+)/([\w]+)/[\w]+.txt""".r
    val r1(a, b) = s
    new Case(a, b)
  }

}
